from rest_framework.views import exception_handler


def my_exception_handler(exc, context):
    response = exception_handler(exc, context)

    result = {
        "code": 1,
        "message": {}
    }

    if response:
        result["message"].update(response.data)
        response.data = result
        response.status_code = 200
        return response

